package com.lhy.framework.test.common;

import com.lhy.framework.beans.BeansException;
import com.lhy.framework.beans.PropertyValue;
import com.lhy.framework.beans.PropertyValues;
import com.lhy.framework.beans.factory.ConfigurablelistableBeanFactory;
import com.lhy.framework.beans.factory.factory.BeanDefinition;
import com.lhy.framework.beans.factory.factory.BeanFactoryPostProcessor;

/**
 * @ClassName MyBeanFactoryPostProcessor
 * @Description
 * @Author lihaiyang
 * @Date 2022/9/12 11:12
 * @Version 1.0
 */
public class MyBeanFactoryPostProcessor implements BeanFactoryPostProcessor {
    @Override
    public void postProcessBeanFactory(ConfigurablelistableBeanFactory beanFactory) throws BeansException {
        BeanDefinition beanDefinition = beanFactory.getBeanDefinition("userService");
        PropertyValues propertyValues = beanDefinition.getPropertyValues();
        propertyValues.addPropertyValue(new PropertyValue("company","改为：字节跳动"));
    }
}
